package cn.com.code.design;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 链路抽象定义
 *
 * @author zhengpei
 * @date 2021/10/24
 */
public abstract class AuthLink {

  private static final Logger logger = LoggerFactory.getLogger(AuthLink.class);

  protected SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

  // 级别人员Id
  protected String levelUserId;

  // 级别人员姓名
  protected String levelUserName;

  // 责任链 获取下一个节点
  private AuthLink next;

  public AuthLink(String levelUserId, String levelUserName) {
    this.levelUserId = levelUserId;
    this.levelUserName = levelUserName;
  }

  public AuthLink next() {
    return next;
  }

  public AuthLink appendNext(AuthLink next) {
    this.next = next;
    return this;
  }

  public abstract AuthInfo doAuth(String uId, String orderId, Date authDate);

}
